import { Toast  } from "vant";
import cTitle from "components/title";

export default {
  data() {
    return {
        goods: {},
        price: ''
    };
  },

  components: {
    cTitle
  },
  activated() {
    console.log(this.$route.params,'我要改价')
    let info = this.$route.params.info;
    this.goods = JSON.parse(info);
    // this.getData();
  },
  computed: {
   
  },
  methods: {
    
    getData(){
        $http.get("ZhengChengYc.shuju_list", {
            uid: localStorage.getItem("uid"),
            time: this.date
          }).then((res) => {
            if (res.result == 1) {
              console.log(res,'shuju_list')
              this.teamYeji = res.data.all_yeji;
              this.zhiyingYeji = res.data.zhitui_yeji;
              this.partnerYeji = res.data.jiantui_yeji;
            }
          });
    },
    submit(){
        var t = this;
        if (t.price == '') {
           Toast('请输入修改价格');
            return
        }
        $http.post("ZhengChengYc.gaijia", {
            uid: localStorage.getItem("uid"),
            goods_id: t.goods.id,
            price: t.price
          }, "加载中").then((res) => {
            if (res.result == 1) {
                this.$router.push(this.fun.getUrl("yunChangeList",{ id:t.goods.id }));
            }else {
                Toast(res.msg);
            }
          });
        
    }
    
  }
};